home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / LT_ShowWindow.c < prev    next >
C/C++ Source or Header  |  1995-09-24  |  1KB  |  72 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. VOID LIBENT
  10. LT_ShowWindow(REG(a0) LayoutHandle *handle,REG(a1) BOOL activate)
  11. {
  12.     if(handle)
  13.     {
  14.         struct Window *window;
  15.         ULONG flags,mask;
  16.  
  17.         window = handle -> Window;
  18.         flags = NULL;
  19.         mask = NULL;
  20.  
  21.         WindowToFront(window);
  22.  
  23.         if(activate)
  24.         {
  25.                 // activate the window
  26.  
  27.             ActivateWindow(window);
  28.  
  29.                 // wait for the window to become active
  30.  
  31.             flags |= WFLG_WINDOWACTIVE;
  32.             mask |= WFLG_WINDOWACTIVE;
  33.         }
  34.  
  35.         ScreenToFront(window -> WScreen);
  36.  
  37.         if(!handle -> ResizeView && (handle -> Window -> Flags & (WFLG_HASZOOM | WFLG_ZOOMED)) == (WFLG_HASZOOM | WFLG_ZOOMED))
  38.         {
  39.                 // make the window full-sized
  40.  
  41.             ZipWindow(window);
  42.  
  43.                 // wait for the zoom bit to get cleared
  44.  
  45.             flags &= ~WFLG_ZOOMED;
  46.             mask |= WFLG_ZOOMED;
  47.         }
  48.  
  49.             // wait for the window to change state?
  50.  
  51.         if(mask)
  52.         {
  53.             WORD i;
  54.  
  55.                 // wait for the window to change state
  56.  
  57.             for(i = 0 ; i < 300 ; i++)
  58.             {
  59.                 if((handle -> Window -> Flags & mask) == flags)
  60.                     break;
  61.                 else
  62.                     WaitTOF();
  63.             }
  64.         }
  65.  
  66.             // make the window visible on the screen by
  67.             // scrolling it into view
  68.  
  69.         LTP_MoveToWindow(handle);
  70.     }
  71. }
  72.